package cn.chinaiptv.apkmanager.bean;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * EPG背景图片
 * 
 * @author Administrator
 *
 */
public class Epgbg {
	private int epgbg_id;
	private String epgbg_platform;
	private String epgbg_option;
	private String epgbg_background;

	/**
	 * EPG背景图片post参数
	 *
	 * @param epgrecomms
	 * @return
	 */
	public static String getPostJson(Epgbg epgbg) {
		JSONObject obj = new JSONObject();
		JSONObject headerObj = new JSONObject();
		JSONObject bodyObj = new JSONObject();
		String result = null;
		try {
			// 封装头部
			headerObj.put("paltform", epgbg.getEpgbg_platform());
			headerObj.put("option", epgbg.getEpgbg_option());
			obj.put("header", headerObj);
			// 封装body

			bodyObj.put("background", epgbg.getEpgbg_background());
			obj.put("body", bodyObj);
			result = obj.toString();
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return result;
	}

	public int getEpgbg_id() {
		return epgbg_id;
	}

	public void setEpgbg_id(int epgbg_id) {
		this.epgbg_id = epgbg_id;
	}

	public String getEpgbg_platform() {
		return epgbg_platform;
	}

	public void setEpgbg_platform(String epgbg_platform) {
		this.epgbg_platform = epgbg_platform;
	}

	public String getEpgbg_option() {
		return epgbg_option;
	}

	public void setEpgbg_option(String epgbg_option) {
		this.epgbg_option = epgbg_option;
	}

	public String getEpgbg_background() {
		return epgbg_background;
	}

	public void setEpgbg_background(String epgbg_background) {
		this.epgbg_background = epgbg_background;
	}

	public Epgbg() {
		super();
	}

	public Epgbg(int epgbg_id, String epgbg_platform, String epgbg_option,
			String epgbg_background) {
		super();
		this.epgbg_id = epgbg_id;
		this.epgbg_platform = epgbg_platform;
		this.epgbg_option = epgbg_option;
		this.epgbg_background = epgbg_background;
	}

	@Override
	public String toString() {
		return "Epgbg [epgbg_id=" + epgbg_id + ", epgbg_platform="
				+ epgbg_platform + ", epgbg_option=" + epgbg_option
				+ ", epgbg_background=" + epgbg_background + "]";
	}

}
